package com.xxl.job.executor.service.jobhandler;

import org.springframework.stereotype.Component;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import com.xxl.job.executor.process.TemperatureSensingOpticalFiberProcess;

@JobHandler(value = "temperatureSensingOpticalFiberJobHandler")
@Component
public class TemperatureSensingOpticalFiberJobHandler extends IJobHandler {
	@Override
	public ReturnT<String> execute(String param) throws Exception{
		// 判断入参数据合法性
		if (param.length() < 7) {
			XxlJobLogger.log("非法采集口号，程序退出");
			return FAIL;
		}
		XxlJobLogger.log("====Start Collect Job,GatherID:" + param + "====");

		TemperatureSensingOpticalFiberProcess temperatureSensingOpticalFiberProcess = new TemperatureSensingOpticalFiberProcess(param);
		temperatureSensingOpticalFiberProcess.collectProcess();

		return SUCCESS;
	}
}
